package com.daijia.entity.location;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;

import org.apache.commons.lang.builder.ToStringBuilder;

import com.daijia.entity.IdEntity;

public class Address extends IdEntity {

	@OneToOne(cascade = CascadeType.ALL)
	@JoinColumn(name = "city_ref")
	private City city;
	@OneToOne(cascade = CascadeType.ALL)
    @JoinColumn(name = "area_ref")	
    private Area area;
	@OneToOne(cascade = CascadeType.ALL)
	@JoinColumn(name = "location_mark_ref")
	private LocationMark locationMark;
	@Column(name = "location_detail")
	private String locationDetail;
	
	public City getCity() {
		return city;
	}
	public void setCity(City city) {
		this.city = city;
	}
	public Area getArea() {
		return area;
	}
	public void setArea(Area area) {
		this.area = area;
	}
	public LocationMark getLocationMark() {
		return locationMark;
	}
	public void setLocationMark(LocationMark locationMark) {
		this.locationMark = locationMark;
	}
	public String getLocationDetail() {
		return locationDetail;
	}
	public void setLocationDetail(String locationDetail) {
		this.locationDetail = locationDetail;
	}
	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this);
	}
	
}
